package com.example.demo.repository;

import com.example.demo.entity.Reservation;
import com.example.demo.entity.User;
import com.example.demo.entity.Lab;
import com.example.demo.entity.ReservationStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface ReservationRepository extends JpaRepository<Reservation, Long> {
    List<Reservation> findByUser(User user);
    List<Reservation> findByUserAndStatus(User user, ReservationStatus status);
    List<Reservation> findByLab(Lab lab);
    List<Reservation> findByStatus(ReservationStatus status);
    List<Reservation> findByApprover(User approver);
    List<Reservation> findByStartTimeBetween(LocalDateTime start, LocalDateTime end);
    List<Reservation> findByUserAndStartTimeBetween(User user, LocalDateTime start, LocalDateTime end);
    List<Reservation> findByLabId(Long labId);
} 